package com.zkthink.ceres.promotion.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.zkthink.base.entity.Entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;
import java.time.LocalDateTime;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import static com.zkthink.utils.DateUtils.DEFAULT_DATE_TIME_FORMAT;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 分销员
 * </p>
 *
 * @author kellen
 * @since 2020-08-22
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("ceres_sales_prom_config")
@ApiModel(value = "SalesPromConfig", description = "分销员")
@AllArgsConstructor
public class SalesPromConfig extends Entity<Long> {

    private static final long serialVersionUID = 1L;

    /**
     * 店铺logo是否展示  1是 2否
     */
    @ApiModelProperty(value = "店铺logo是否展示  1是 2否")
    @NotNull(message = "店铺logo是否展示  1是 2否不能为空")
    @TableField("is_show_shop_logo")
    @Excel(name = "店铺logo是否展示  1是 2否")
    private Integer isShowShopLogo;

    /**
     * 头像昵称是否展示 1是 2否
     */
    @ApiModelProperty(value = "头像昵称是否展示 1是 2否")
    @NotNull(message = "头像昵称是否展示 1是 2否不能为空")
    @TableField("is_show_nick_name")
    @Excel(name = "头像昵称是否展示 1是 2否")
    private Integer isShowNickName;

    /**
     * 推荐语
     */
    @ApiModelProperty(value = "推荐语")
    @NotEmpty(message = "推荐语不能为空")
    @Length(max = 1000, message = "推荐语长度不能超过1000")
    @TableField(value = "invite_text", condition = LIKE)
    @Excel(name = "推荐语")
    private String inviteText;

    /**
     * 背景图
     */
    @ApiModelProperty(value = "背景图")
    @NotEmpty(message = "背景图不能为空")
    @Length(max = 500, message = "背景图长度不能超过500")
    @TableField(value = "back_img", condition = LIKE)
    @Excel(name = "背景图")
    private String backImg;

    /**
     * 类型 1店铺推荐 2邀请下级
     */
    @ApiModelProperty(value = "类型 1店铺推荐 2邀请下级")
    @NotNull(message = "类型 1店铺推荐 2邀请下级不能为空")
    @TableField("type")
    @Excel(name = "类型 1店铺推荐 2邀请下级")
    private Integer type;

    /**
     * 逻辑删除 1-删除 0-未删除
     */
    @ApiModelProperty(value = "逻辑删除 1-删除 0-未删除")
    @NotNull(message = "逻辑删除 1-删除 0-未删除不能为空")
    @TableField("is_delete")
    @Excel(name = "逻辑删除 1-删除 0-未删除")
    private Integer isDelete;

    @ApiModelProperty(value = "企业编码")
    @NotEmpty(message = "企业编码不能为空")
    @Length(max = 10, message = "企业编码长度不能超过10")
    private String tenantCode;


    @Builder
    public SalesPromConfig(Long id, LocalDateTime updateTime, Long updateUser, LocalDateTime createTime, Long createUser,
                    Integer isShowShopLogo, Integer isShowNickName, String inviteText, String backImg, Integer type,
                    Integer isDelete, String tenantCode) {
        this.id = id;
        this.updateTime = updateTime;
        this.updateUser = updateUser;
        this.createTime = createTime;
        this.createUser = createUser;
        this.isShowShopLogo = isShowShopLogo;
        this.isShowNickName = isShowNickName;
        this.inviteText = inviteText;
        this.backImg = backImg;
        this.type = type;
        this.isDelete = isDelete;
        this.tenantCode = tenantCode;
    }

}
